/*
 *此javaCode由YMS-JDBC替换工具生成，原mapper位置com.yonyou.ucf.mdf.app.isvdxq.other.mapper.ProductEntityMapper
 */
package com.yonyou.ucf.mdf.app.isvdxq.other.mapper.impl;

import com.yonyou.iuap.yms.api.IYmsJdbcApi;
import com.yonyou.iuap.yms.param.*;
import com.yonyou.iuap.yms.param.ResultSetProcessor;
import com.yonyou.iuap.yms.processor.*;
import com.yonyou.iuap.yms.replace.YmsSqlUtil;
import com.yonyou.ucf.mdf.app.isvdxq.other.entity.ProductEntity;
import java.sql.Types;
import java.util.*;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import static com.yonyou.iuap.yms.replace.YmsSqlUtil.WherePrefixList;

@Repository
public class ProductEntityMapperImpl {
    
    @Autowired
    private IYmsJdbcApi ymsJdbcApi;
    //com.yonyou.ucf.mdf.app.isvdxq.other.mapper.ProductEntityMapper.findPageWithCount
    
    public Integer findPageWithCount(ProductEntity product) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" select count(1) ");
		sqlBuilder.append(" from dxqyy_product ");
		StringBuilder trimBuilder0 = new StringBuilder();
		trimBuilder0.append(" 1=1 ");
		if (product.getId() != null) {
			trimBuilder0.append(" and id = ? ");
			parameter.addParamWithType(product.getId(), Types.BIGINT);
		}
		if (product.getCode() != null && !"".equals(product.getCode())) {
			trimBuilder0.append(" and code = ? ");
			parameter.addParamWithType(product.getCode(), Types.VARCHAR);
		}
		if (product.getShortName() != null && !"".equals(product.getShortName())) {
			trimBuilder0.append(" and name = ? ");
			parameter.addParamWithType(product.getShortName(), Types.VARCHAR);
		}
		if (product.getUnit() != null && !"".equals(product.getUnit())) {
			trimBuilder0.append(" and unit = ? ");
			parameter.addParamWithType(product.getUnit(), Types.VARCHAR);
		}
		if (product.getUnitUseType() != null) {
			trimBuilder0.append(" and unitUseType = ? ");
			parameter.addParamWithType(product.getUnitUseType(), Types.INTEGER);
		}
		if (product.getStockUnit() != null && !"".equals(product.getStockUnit())) {
			trimBuilder0.append(" and stockUnit = ? ");
			parameter.addParamWithType(product.getStockUnit(), Types.VARCHAR);
		}
		if (product.getDefaultSKUId() != null && !"".equals(product.getDefaultSKUId())) {
			trimBuilder0.append(" and defaultSKUId = ? ");
			parameter.addParamWithType(product.getDefaultSKUId(), Types.VARCHAR);
		}
		if (product.getOrgId() != null && !"".equals(product.getOrgId())) {
			trimBuilder0.append(" and orgId = ? ");
			parameter.addParamWithType(product.getOrgId(), Types.VARCHAR);
		}
		if (product.getOrgId_Name() != null && !"".equals(product.getOrgId_Name())) {
			trimBuilder0.append(" and orgId_Name = ? ");
			parameter.addParamWithType(product.getOrgId_Name(), Types.VARCHAR);
		}
		if (product.getProductApplyRangeId() != null && !"".equals(product.getProductApplyRangeId())) {
			trimBuilder0.append(" and productApplyRangeId = ? ");
			parameter.addParamWithType(product.getProductApplyRangeId(), Types.VARCHAR);
		}
		if (product.getProductApplyRange_OrgId() != null && !"".equals(product.getProductApplyRange_OrgId())) {
			trimBuilder0.append(" and productApplyRange_OrgId = ? ");
			parameter.addParamWithType(product.getProductApplyRange_OrgId(), Types.VARCHAR);
		}
		if (product.getProductClass() != null && !"".equals(product.getProductClass())) {
			trimBuilder0.append(" and productClass = ? ");
			parameter.addParamWithType(product.getProductClass(), Types.VARCHAR);
		}
		if (product.getProductClass_Code() != null && !"".equals(product.getProductClass_Code())) {
			trimBuilder0.append(" and productClass_Code = ? ");
			parameter.addParamWithType(product.getProductClass_Code(), Types.VARCHAR);
		}
		if (product.getManageClass() != null && !"".equals(product.getManageClass())) {
			trimBuilder0.append(" and manageClass = ? ");
			parameter.addParamWithType(product.getManageClass(), Types.VARCHAR);
		}
		if (product.getManageClass_Code() != null && !"".equals(product.getManageClass_Code())) {
			trimBuilder0.append(" and manageClass_Code = ? ");
			parameter.addParamWithType(product.getManageClass_Code(), Types.VARCHAR);
		}
		if (product.getEventNotify_status() != null && !"".equals(product.getEventNotify_status())) {
			trimBuilder0.append(" and eventNotify_status = ? ");
			parameter.addParamWithType(product.getEventNotify_status(), Types.VARCHAR);
		}
		if (product.getIsEnabled() != null && !"".equals(product.getIsEnabled())) {
			trimBuilder0.append(" and isEnabled = ? ");
			parameter.addParamWithType(product.getIsEnabled(), Types.VARCHAR);
		}
		if (product.getIsStop() != null && !"".equals(product.getIsStop())) {
			trimBuilder0.append(" and isStop = ? ");
			parameter.addParamWithType(product.getIsStop(), Types.VARCHAR);
		}
		if (product.getIsAuthorizationManager() != null && !"".equals(product.getIsAuthorizationManager())) {
			trimBuilder0.append(" and isAuthorizationManager = ? ");
			parameter.addParamWithType(product.getIsAuthorizationManager(), Types.VARCHAR);
		}
		if (product.getIsCreator() != null && !"".equals(product.getIsCreator())) {
			trimBuilder0.append(" and isCreator = ? ");
			parameter.addParamWithType(product.getIsCreator(), Types.VARCHAR);
		}
		if (product.getIsRegistrationManager() != null && !"".equals(product.getIsRegistrationManager())) {
			trimBuilder0.append(" and isRegistrationManager = ? ");
			parameter.addParamWithType(product.getIsRegistrationManager(), Types.VARCHAR);
		}
		if (product.getHasSpecs() != null && !"".equals(product.getHasSpecs())) {
			trimBuilder0.append(" and hasSpecs = ? ");
			parameter.addParamWithType(product.getHasSpecs(), Types.VARCHAR);
		}
		if (product.getRealProductAttribute() != null) {
			trimBuilder0.append(" and realProductAttribute = ? ");
			parameter.addParamWithType(product.getRealProductAttribute(), Types.INTEGER);
		}
		if (product.getRealProductAttributeType() != null) {
			trimBuilder0.append(" and realProductAttributeType = ? ");
			parameter.addParamWithType(product.getRealProductAttributeType(), Types.INTEGER);
		}
		if (product.getModifier() != null && !"".equals(product.getModifier())) {
			trimBuilder0.append(" and modifier = ? ");
			parameter.addParamWithType(product.getModifier(), Types.VARCHAR);
		}
		if (product.getModifierId() != null && !"".equals(product.getModifierId())) {
			trimBuilder0.append(" and modifierId = ? ");
			parameter.addParamWithType(product.getModifierId(), Types.VARCHAR);
		}
		if (product.getModifyTime() != null && !"".equals(product.getModifyTime())) {
			trimBuilder0.append(" and modifyTime = ? ");
			parameter.addParamWithType(product.getModifyTime(), Types.VARCHAR);
		}
		if (product.getPubts() != null && !"".equals(product.getPubts())) {
			trimBuilder0.append(" and pubts = ? ");
			parameter.addParamWithType(product.getPubts(), Types.VARCHAR);
		}
		sqlBuilder.append(YmsSqlUtil.trimSql(trimBuilder0, "WHERE", null, WherePrefixList, null));

        
        String sql = sqlBuilder.toString();
        ResultSetProcessor processor = new ColumnProcessor(Integer.class);
        return (Integer) ymsJdbcApi.queryForObject(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.other.mapper.ProductEntityMapper.update
    
    public int update(ProductEntity product) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "update dxqyy_product         \n" + 
			         "set code = ?,                \n" + 
			         "name = ?,                    \n" + 
			         "unit = ?,                    \n" + 
			         "unitUseType = ?,             \n" + 
			         "stockUnit = ?,               \n" + 
			         "defaultSKUId = ?,            \n" + 
			         "orgId = ?,                   \n" + 
			         "orgId_Name = ?,              \n" + 
			         "productApplyRangeId = ?,     \n" + 
			         "productApplyRange_OrgId = ?, \n" + 
			         "productClass = ?,            \n" + 
			         "productClass_Code = ?,       \n" + 
			         "manageClass = ?,             \n" + 
			         "manageClass_Code = ?,        \n" + 
			         "eventNotify_status = ?,      \n" + 
			         "isEnabled = ?,               \n" + 
			         "isStop = ?,                  \n" + 
			         "isAuthorizationManager = ?,  \n" + 
			         "isCreator = ?,               \n" + 
			         "isRegistrationManager = ?,   \n" + 
			         "hasSpecs = ?,                \n" + 
			         "realProductAttribute = ?,    \n" + 
			         "realProductAttributeType = ?,\n" + 
			         "modifier = ?,                \n" + 
			         "modifierId = ?,              \n" + 
			         "modifyTime = ?,              \n" + 
			         "pubts = ?                    \n" + 
			         "where id = ?                 \n";
        parameter.addParamWithType(product.getCode(), Types.VARCHAR);
		parameter.addParamWithType(product.getShortName(), Types.VARCHAR);
		parameter.addParamWithType(product.getUnit(), Types.VARCHAR);
		parameter.addParamWithType(product.getUnitUseType(), Types.INTEGER);
		parameter.addParamWithType(product.getStockUnit(), Types.VARCHAR);
		parameter.addParamWithType(product.getDefaultSKUId(), Types.VARCHAR);
		parameter.addParamWithType(product.getOrgId(), Types.VARCHAR);
		parameter.addParamWithType(product.getOrgId_Name(), Types.VARCHAR);
		parameter.addParamWithType(product.getProductApplyRangeId(), Types.VARCHAR);
		parameter.addParamWithType(product.getProductApplyRange_OrgId(), Types.VARCHAR);
		parameter.addParamWithType(product.getProductClass(), Types.VARCHAR);
		parameter.addParamWithType(product.getProductClass_Code(), Types.VARCHAR);
		parameter.addParamWithType(product.getManageClass(), Types.VARCHAR);
		parameter.addParamWithType(product.getManageClass_Code(), Types.VARCHAR);
		parameter.addParamWithType(product.getEventNotify_status(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsEnabled(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsStop(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsAuthorizationManager(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsCreator(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsRegistrationManager(), Types.VARCHAR);
		parameter.addParamWithType(product.getHasSpecs(), Types.VARCHAR);
		parameter.addParamWithType(product.getRealProductAttribute(), Types.INTEGER);
		parameter.addParamWithType(product.getRealProductAttributeType(), Types.INTEGER);
		parameter.addParamWithType(product.getModifier(), Types.VARCHAR);
		parameter.addParamWithType(product.getModifierId(), Types.VARCHAR);
		parameter.addParamWithType(product.getModifyTime(), Types.VARCHAR);
		parameter.addParamWithType(product.getPubts(), Types.VARCHAR);
		parameter.addParamWithType(product.getId(), Types.BIGINT);

        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.other.mapper.ProductEntityMapper.insert
    
    public int insert(ProductEntity product) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "insert into dxqyy_product (id, code, productName,     \n" + 
			         "unit, unitUseType, stockUnit,                         \n" + 
			         "defaultSKUId, orgId, orgId_Name,                      \n" + 
			         "productApplyRangeId, productApplyRange_OrgId,         \n" + 
			         "productClass, productClass_Code, manageClass,         \n" + 
			         "manageClass_Code, eventNotify_status, isEnabled,      \n" + 
			         "isStop, isAuthorizationManager, isCreator,            \n" + 
			         "isRegistrationManager, hasSpecs, realProductAttribute,\n" + 
			         "realProductAttributeType, modifier, modifierId,       \n" + 
			         "modifyTime, pubts)                                    \n" + 
			         "values (?, ?, ?,                                      \n" + 
			         "?, ?, ?,                                              \n" + 
			         "?, ?, ?,                                              \n" + 
			         "?, ?,                                                 \n" + 
			         "?, ?, ?,                                              \n" + 
			         "?, ?, ?,                                              \n" + 
			         "?, ?, ?,                                              \n" + 
			         "?, ?, ?,                                              \n" + 
			         "?, ?, ?,                                              \n" + 
			         "?, ?)                                                 \n";
        parameter.addParamWithType(product.getId(), Types.BIGINT);
		parameter.addParamWithType(product.getCode(), Types.VARCHAR);
		parameter.addParamWithType(product.getProductName(), Types.VARCHAR);
		parameter.addParamWithType(product.getUnit(), Types.VARCHAR);
		parameter.addParamWithType(product.getUnitUseType(), Types.INTEGER);
		parameter.addParamWithType(product.getStockUnit(), Types.VARCHAR);
		parameter.addParamWithType(product.getDefaultSKUId(), Types.VARCHAR);
		parameter.addParamWithType(product.getOrgId(), Types.VARCHAR);
		parameter.addParamWithType(product.getOrgId_Name(), Types.VARCHAR);
		parameter.addParamWithType(product.getProductApplyRangeId(), Types.VARCHAR);
		parameter.addParamWithType(product.getProductApplyRange_OrgId(), Types.VARCHAR);
		parameter.addParamWithType(product.getProductClass(), Types.VARCHAR);
		parameter.addParamWithType(product.getProductClass_Code(), Types.VARCHAR);
		parameter.addParamWithType(product.getManageClass(), Types.VARCHAR);
		parameter.addParamWithType(product.getManageClass_Code(), Types.VARCHAR);
		parameter.addParamWithType(product.getEventNotify_status(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsEnabled(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsStop(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsAuthorizationManager(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsCreator(), Types.VARCHAR);
		parameter.addParamWithType(product.getIsRegistrationManager(), Types.VARCHAR);
		parameter.addParamWithType(product.getHasSpecs(), Types.VARCHAR);
		parameter.addParamWithType(product.getRealProductAttribute(), Types.INTEGER);
		parameter.addParamWithType(product.getRealProductAttributeType(), Types.INTEGER);
		parameter.addParamWithType(product.getModifier(), Types.VARCHAR);
		parameter.addParamWithType(product.getModifierId(), Types.VARCHAR);
		parameter.addParamWithType(product.getModifyTime(), Types.VARCHAR);
		parameter.addParamWithType(product.getPubts(), Types.VARCHAR);

        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.other.mapper.ProductEntityMapper.findPageWithResult
    
    public List<ProductEntity> findPageWithResult(ProductEntity product, int m, int n) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" select ");
		sqlBuilder.append(" id, code, `productName`, unit, unitUseType, stockUnit, defaultSKUId, orgId, orgId_Name, productApplyRangeId, ");
		sqlBuilder.append(" productApplyRange_OrgId, productClass, productClass_Code, manageClass, manageClass_Code, ");
		sqlBuilder.append(" eventNotify_status, isEnabled, isStop, isAuthorizationManager, isCreator, isRegistrationManager, ");
		sqlBuilder.append(" hasSpecs, realProductAttribute, realProductAttributeType, modifier, modifierId, modifyTime, ");
		sqlBuilder.append(" pubts ");
		sqlBuilder.append(" from dxqyy_product ");
		StringBuilder trimBuilder0 = new StringBuilder();
		trimBuilder0.append(" 1=1 ");
		if (product.getId() != null) {
			trimBuilder0.append(" and id = ? ");
			parameter.addParamWithType(product.getId(), Types.BIGINT);
		}
		if (product.getCode() != null && !"".equals(product.getCode())) {
			trimBuilder0.append(" and code = ? ");
			parameter.addParamWithType(product.getCode(), Types.VARCHAR);
		}
		if (product.getShortName() != null && !"".equals(product.getShortName())) {
			trimBuilder0.append(" and name = ? ");
			parameter.addParamWithType(product.getShortName(), Types.VARCHAR);
		}
		if (product.getUnit() != null && !"".equals(product.getUnit())) {
			trimBuilder0.append(" and unit = ? ");
			parameter.addParamWithType(product.getUnit(), Types.VARCHAR);
		}
		if (product.getUnitUseType() != null) {
			trimBuilder0.append(" and unitUseType = ? ");
			parameter.addParamWithType(product.getUnitUseType(), Types.INTEGER);
		}
		if (product.getStockUnit() != null && !"".equals(product.getStockUnit())) {
			trimBuilder0.append(" and stockUnit = ? ");
			parameter.addParamWithType(product.getStockUnit(), Types.VARCHAR);
		}
		if (product.getDefaultSKUId() != null && !"".equals(product.getDefaultSKUId())) {
			trimBuilder0.append(" and defaultSKUId = ? ");
			parameter.addParamWithType(product.getDefaultSKUId(), Types.VARCHAR);
		}
		if (product.getOrgId() != null && !"".equals(product.getOrgId())) {
			trimBuilder0.append(" and orgId = ? ");
			parameter.addParamWithType(product.getOrgId(), Types.VARCHAR);
		}
		if (product.getOrgId_Name() != null && !"".equals(product.getOrgId_Name())) {
			trimBuilder0.append(" and orgId_Name = ? ");
			parameter.addParamWithType(product.getOrgId_Name(), Types.VARCHAR);
		}
		if (product.getProductApplyRangeId() != null && !"".equals(product.getProductApplyRangeId())) {
			trimBuilder0.append(" and productApplyRangeId = ? ");
			parameter.addParamWithType(product.getProductApplyRangeId(), Types.VARCHAR);
		}
		if (product.getProductApplyRange_OrgId() != null && !"".equals(product.getProductApplyRange_OrgId())) {
			trimBuilder0.append(" and productApplyRange_OrgId = ? ");
			parameter.addParamWithType(product.getProductApplyRange_OrgId(), Types.VARCHAR);
		}
		if (product.getProductClass() != null && !"".equals(product.getProductClass())) {
			trimBuilder0.append(" and productClass = ? ");
			parameter.addParamWithType(product.getProductClass(), Types.VARCHAR);
		}
		if (product.getProductClass_Code() != null && !"".equals(product.getProductClass_Code())) {
			trimBuilder0.append(" and productClass_Code = ? ");
			parameter.addParamWithType(product.getProductClass_Code(), Types.VARCHAR);
		}
		if (product.getManageClass() != null && !"".equals(product.getManageClass())) {
			trimBuilder0.append(" and manageClass = ? ");
			parameter.addParamWithType(product.getManageClass(), Types.VARCHAR);
		}
		if (product.getManageClass_Code() != null && !"".equals(product.getManageClass_Code())) {
			trimBuilder0.append(" and manageClass_Code = ? ");
			parameter.addParamWithType(product.getManageClass_Code(), Types.VARCHAR);
		}
		if (product.getEventNotify_status() != null && !"".equals(product.getEventNotify_status())) {
			trimBuilder0.append(" and eventNotify_status = ? ");
			parameter.addParamWithType(product.getEventNotify_status(), Types.VARCHAR);
		}
		if (product.getIsEnabled() != null && !"".equals(product.getIsEnabled())) {
			trimBuilder0.append(" and isEnabled = ? ");
			parameter.addParamWithType(product.getIsEnabled(), Types.VARCHAR);
		}
		if (product.getIsStop() != null && !"".equals(product.getIsStop())) {
			trimBuilder0.append(" and isStop = ? ");
			parameter.addParamWithType(product.getIsStop(), Types.VARCHAR);
		}
		if (product.getIsAuthorizationManager() != null && !"".equals(product.getIsAuthorizationManager())) {
			trimBuilder0.append(" and isAuthorizationManager = ? ");
			parameter.addParamWithType(product.getIsAuthorizationManager(), Types.VARCHAR);
		}
		if (product.getIsCreator() != null && !"".equals(product.getIsCreator())) {
			trimBuilder0.append(" and isCreator = ? ");
			parameter.addParamWithType(product.getIsCreator(), Types.VARCHAR);
		}
		if (product.getIsRegistrationManager() != null && !"".equals(product.getIsRegistrationManager())) {
			trimBuilder0.append(" and isRegistrationManager = ? ");
			parameter.addParamWithType(product.getIsRegistrationManager(), Types.VARCHAR);
		}
		if (product.getHasSpecs() != null && !"".equals(product.getHasSpecs())) {
			trimBuilder0.append(" and hasSpecs = ? ");
			parameter.addParamWithType(product.getHasSpecs(), Types.VARCHAR);
		}
		if (product.getRealProductAttribute() != null) {
			trimBuilder0.append(" and realProductAttribute = ? ");
			parameter.addParamWithType(product.getRealProductAttribute(), Types.INTEGER);
		}
		if (product.getRealProductAttributeType() != null) {
			trimBuilder0.append(" and realProductAttributeType = ? ");
			parameter.addParamWithType(product.getRealProductAttributeType(), Types.INTEGER);
		}
		if (product.getModifier() != null && !"".equals(product.getModifier())) {
			trimBuilder0.append(" and modifier = ? ");
			parameter.addParamWithType(product.getModifier(), Types.VARCHAR);
		}
		if (product.getModifierId() != null && !"".equals(product.getModifierId())) {
			trimBuilder0.append(" and modifierId = ? ");
			parameter.addParamWithType(product.getModifierId(), Types.VARCHAR);
		}
		if (product.getModifyTime() != null && !"".equals(product.getModifyTime())) {
			trimBuilder0.append(" and modifyTime = ? ");
			parameter.addParamWithType(product.getModifyTime(), Types.VARCHAR);
		}
		if (product.getPubts() != null && !"".equals(product.getPubts())) {
			trimBuilder0.append(" and pubts = ? ");
			parameter.addParamWithType(product.getPubts(), Types.VARCHAR);
		}
		sqlBuilder.append(YmsSqlUtil.trimSql(trimBuilder0, "WHERE", null, WherePrefixList, null));
		sqlBuilder.append(" limit ?,? ");
		parameter.addParam(m);
		parameter.addParam(n);

        
        String sql = sqlBuilder.toString();
        ResultSetProcessor processor = new AutoBeanListProcessor(new ProductEntity());
        return (List<ProductEntity>) ymsJdbcApi.queryForList(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.other.mapper.ProductEntityMapper.selectById
    
    public ProductEntity selectById(Long id) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "select                                                                                                      \n" + 
			         "id, code, `productName`, unit, unitUseType, stockUnit, defaultSKUId, orgId, orgId_Name, productApplyRangeId,\n" + 
			         "productApplyRange_OrgId, productClass, productClass_Code, manageClass, manageClass_Code,                    \n" + 
			         "eventNotify_status, isEnabled, isStop, isAuthorizationManager, isCreator, isRegistrationManager,            \n" + 
			         "hasSpecs, realProductAttribute, realProductAttributeType, modifier, modifierId, modifyTime,                 \n" + 
			         "pubts                                                                                                       \n" + 
			         "from  dxqyy_product                                                                                         \n" + 
			         "where id = ?                                                                                                \n";
        parameter.addParamWithType(id, Types.BIGINT);

        ResultSetProcessor processor = new AutoBeanProcessor(new ProductEntity());
        return (ProductEntity) ymsJdbcApi.queryForObject(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.other.mapper.ProductEntityMapper.updateDynamic
    
    public int updateDynamic(ProductEntity product) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" update dxqyy_product ");
		StringBuilder trimBuilder0 = new StringBuilder();
		if (product.getCode() != null) {
			trimBuilder0.append(" code = ?, ");
			parameter.addParamWithType(product.getCode(), Types.VARCHAR);
		}
		if (product.getShortName() != null) {
			trimBuilder0.append(" `name` = ?, ");
			parameter.addParamWithType(product.getShortName(), Types.VARCHAR);
		}
		if (product.getUnit() != null) {
			trimBuilder0.append(" unit = ?, ");
			parameter.addParamWithType(product.getUnit(), Types.VARCHAR);
		}
		if (product.getUnitUseType() != null) {
			trimBuilder0.append(" unitUseType = ?, ");
			parameter.addParamWithType(product.getUnitUseType(), Types.INTEGER);
		}
		if (product.getStockUnit() != null) {
			trimBuilder0.append(" stockUnit = ?, ");
			parameter.addParamWithType(product.getStockUnit(), Types.VARCHAR);
		}
		if (product.getDefaultSKUId() != null) {
			trimBuilder0.append(" defaultSKUId = ?, ");
			parameter.addParamWithType(product.getDefaultSKUId(), Types.VARCHAR);
		}
		if (product.getOrgId() != null) {
			trimBuilder0.append(" orgId = ?, ");
			parameter.addParamWithType(product.getOrgId(), Types.VARCHAR);
		}
		if (product.getOrgId_Name() != null) {
			trimBuilder0.append(" orgId_Name = ?, ");
			parameter.addParamWithType(product.getOrgId_Name(), Types.VARCHAR);
		}
		if (product.getProductApplyRangeId() != null) {
			trimBuilder0.append(" productApplyRangeId = ?, ");
			parameter.addParamWithType(product.getProductApplyRangeId(), Types.VARCHAR);
		}
		if (product.getProductApplyRange_OrgId() != null) {
			trimBuilder0.append(" productApplyRange_OrgId = ?, ");
			parameter.addParamWithType(product.getProductApplyRange_OrgId(), Types.VARCHAR);
		}
		if (product.getProductClass() != null) {
			trimBuilder0.append(" productClass = ?, ");
			parameter.addParamWithType(product.getProductClass(), Types.VARCHAR);
		}
		if (product.getProductClass_Code() != null) {
			trimBuilder0.append(" productClass_Code = ?, ");
			parameter.addParamWithType(product.getProductClass_Code(), Types.VARCHAR);
		}
		if (product.getManageClass() != null) {
			trimBuilder0.append(" manageClass = ?, ");
			parameter.addParamWithType(product.getManageClass(), Types.VARCHAR);
		}
		if (product.getManageClass_Code() != null) {
			trimBuilder0.append(" manageClass_Code = ?, ");
			parameter.addParamWithType(product.getManageClass_Code(), Types.VARCHAR);
		}
		if (product.getEventNotify_status() != null) {
			trimBuilder0.append(" eventNotify_status = ?, ");
			parameter.addParamWithType(product.getEventNotify_status(), Types.VARCHAR);
		}
		if (product.getIsEnabled() != null) {
			trimBuilder0.append(" isEnabled = ?, ");
			parameter.addParamWithType(product.getIsEnabled(), Types.VARCHAR);
		}
		if (product.getIsStop() != null) {
			trimBuilder0.append(" isStop = ?, ");
			parameter.addParamWithType(product.getIsStop(), Types.VARCHAR);
		}
		if (product.getIsAuthorizationManager() != null) {
			trimBuilder0.append(" isAuthorizationManager = ?, ");
			parameter.addParamWithType(product.getIsAuthorizationManager(), Types.VARCHAR);
		}
		if (product.getIsCreator() != null) {
			trimBuilder0.append(" isCreator = ?, ");
			parameter.addParamWithType(product.getIsCreator(), Types.VARCHAR);
		}
		if (product.getIsRegistrationManager() != null) {
			trimBuilder0.append(" isRegistrationManager = ?, ");
			parameter.addParamWithType(product.getIsRegistrationManager(), Types.VARCHAR);
		}
		if (product.getHasSpecs() != null) {
			trimBuilder0.append(" hasSpecs = ?, ");
			parameter.addParamWithType(product.getHasSpecs(), Types.VARCHAR);
		}
		if (product.getRealProductAttribute() != null) {
			trimBuilder0.append(" realProductAttribute = ?, ");
			parameter.addParamWithType(product.getRealProductAttribute(), Types.INTEGER);
		}
		if (product.getRealProductAttributeType() != null) {
			trimBuilder0.append(" realProductAttributeType = ?, ");
			parameter.addParamWithType(product.getRealProductAttributeType(), Types.INTEGER);
		}
		if (product.getModifier() != null) {
			trimBuilder0.append(" modifier = ?, ");
			parameter.addParamWithType(product.getModifier(), Types.VARCHAR);
		}
		if (product.getModifierId() != null) {
			trimBuilder0.append(" modifierId = ?, ");
			parameter.addParamWithType(product.getModifierId(), Types.VARCHAR);
		}
		if (product.getModifyTime() != null) {
			trimBuilder0.append(" modifyTime = ?, ");
			parameter.addParamWithType(product.getModifyTime(), Types.VARCHAR);
		}
		if (product.getPubts() != null) {
			trimBuilder0.append(" pubts = ?, ");
			parameter.addParamWithType(product.getPubts(), Types.VARCHAR);
		}
		sqlBuilder.append(YmsSqlUtil.trimSql(trimBuilder0, "SET", null, Collections.singletonList(","), Collections.singletonList(",")));
		sqlBuilder.append(" where id = ? ");
		parameter.addParamWithType(product.getId(), Types.BIGINT);

        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

    //
    
    public int delete(Long id) {
        
        return 0;
    }

    //
    
    public int insertDynamic(ProductEntity product) {
        
        return 0;
    }

}
